package spring.AOPDemo.BeforeAdviceTest;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class WaiterInterceptor implements MethodInterceptor {
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        Object[] objects = methodInvocation.getArguments(); //目标方法入参
        String clientName = (String)objects[0];
        System.out.println("来啦" + clientName);
        Object object = methodInvocation.proceed(); //调用并执行目标方法
        System.out.println("要走啦？" + clientName);
        return object;
    }
}
